using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICBillNoMap : EntityTypeConfiguration<ICBillNo>
    {
        public ICBillNoMap()
        {
            // Primary Key
            this.HasKey(t => t.FBillID);

            // Properties
            this.Property(t => t.FBillID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBillName)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.FPreLetter)
                .HasMaxLength(10);

            this.Property(t => t.FSufLetter)
                .HasMaxLength(10);

            this.Property(t => t.FBillName_CHT)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.FBillName_EN)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.FFormat)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FDesc)
                .IsRequired()
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("ICBillNo");
            this.Property(t => t.FBillID).HasColumnName("FBillID");
            this.Property(t => t.FBillName).HasColumnName("FBillName");
            this.Property(t => t.FPreLetter).HasColumnName("FPreLetter");
            this.Property(t => t.FSufLetter).HasColumnName("FSufLetter");
            this.Property(t => t.FCurNo).HasColumnName("FCurNo");
            this.Property(t => t.FBillName_CHT).HasColumnName("FBillName_CHT");
            this.Property(t => t.FBillName_EN).HasColumnName("FBillName_EN");
            this.Property(t => t.FFormat).HasColumnName("FFormat");
            this.Property(t => t.FPos).HasColumnName("FPos");
            this.Property(t => t.FCanAlterBillNo).HasColumnName("FCanAlterBillNo");
            this.Property(t => t.FCheckAfterSave).HasColumnName("FCheckAfterSave");
            this.Property(t => t.FUseBillCodeRule).HasColumnName("FUseBillCodeRule");
            this.Property(t => t.FDesc).HasColumnName("FDesc");
            this.Property(t => t.FSingleApproval).HasColumnName("FSingleApproval");
            this.Property(t => t.FSingleUnApproval).HasColumnName("FSingleUnApproval");
            this.Property(t => t.FEditSelfBill).HasColumnName("FEditSelfBill");
        }
    }
}
